﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using MethodWorx.CMS.Membership;
using MethodWorx.CMS.Requests;

namespace MethodWorx.CMS.UI.Areas.Administration.Models
{
    public class UserViewModel
    {
        private IUserRepository userRepository;
        public User User { get; set; }
        public IEnumerable<User> Users {get; set; }
        public UserType CurrentUserType { get; internal set; }
        

        public void CreateUserViewModel(IUserRepository userRepository, UserType userType)
        {
            this.userRepository = userRepository;
            this.Users = this.userRepository.GetUsersByUserType(userType);
            CurrentUserType = userType;
        }

        public void CreateUserViewModel(IUserRepository userRepository, UserType userType, Guid userId)
        {
            CreateUserViewModel(userRepository, userType);
            this.User = userRepository[userId];
        }



        public string[] Attributes { get; set; }
    }
}